@extends('layouts.accounts')
@section('content')
    @include('web.accounts.header')
    <style>
        #form-input .fc-inline{display: block;margin-bottom: 10px;}
        #form-input .fc-inline strong{display: inline-block;width: 10%;*display: inline;*zoom: 1;}
        #form-input .fc-inline span{display: inline-block;width: 10%;*display: inline;*zoom: 1; color: red;}
        #form-input .fc-inline input[type=text]{width: 200px;height: 24px;line-height: 24px;}
        #span-ren{color: red}
        #sp-time{color:red}
        #select-box strong{display: inline-block;width: 3%;*display: inline;*zoom: 1;}
        #select-box strong+strong{text-align: center;}
        #select-box select{width: 10%;padding: 7px 4px;}
    </style>
    <i class="i_mng_side_bg"></i>
    <div id="manage_wrap" class="clearfix">
        @include('web.accounts.siderbar')
        <div class="manage_wrap">
            <div class="s_cert_wrap">
                <div class="det-form det-wrap">
                    <div id="formError" class="s_tip"></div>
                    @if ($res->emailkey==1)
                    <form id="form-input" action="" method="post" class="j_ajax"
                          novalidate="novalidate">
                        {{ csrf_field() }}
                        <label class="fc-inline">
                            <strong>安全邮箱: </strong>
                            <input name="email"   class="fc" type="text" value="{{$res->email}}" sync-target="#sendCodeMail" pattern="([a-z0-9_\.\-\+]+)@([\da-z\.\-]+)\.([a-z\.]{2,6})" required="required" data-message="邮箱格式不正确" placeholder="请输入邮箱" >
                           @if ($errors->has('email'))                            
                                <span>{{$errors->first('email',':message')}}</span>
                             @endif
                        </label>
                        <label class="fc-inline">
                        <strong style="height: 36px;line-height: 36px;float: left">验证码: </strong>
                                    <span class="s_l" style="float: left;margin-left: 4px;">
                                        <img src="{{captcha_src()}}" id="captcha_send_msg"
                                             onclick="this.src='{{captcha_src()}}?' + new Date().getTime()" title="换一张" >
                                    </span>
                           @if ($errors->has('captcha'))                            
                                <span>{{$errors->first('captcha',':message')}}</span>
                             @endif
                            <div class="clearfix"></div>
                        </label>
                        <label class="fc-inline">
                            <strong>输入图片验证码: </strong>
                            <input required="required" name="captcha"  class="fc" type="text"
                                   value="">
                        </label>
                        @if($ms==2)
                        <a id="goSendCaptcha" href="javascript:;" class="fs12">认证邮件已经发送，请你尽快查看</a>
                        @else<button type="submit" class="bt bt_block">发送邮箱验证</button>
                        @endif
                    </form>
                    @elseif($res->emailkey==2)
                        <div class="mt30 ml30">
                        <label class="fc-inline mr20 mt20">
                             <strong>邮箱: </strong>
                            <span>{{$res->email}}</span>
                            于{{date('Y-m-d H:i:s',$res->email_time)}}
                        </label>
                        <label class="fc-inline mr20 mt20">
                            <span style="color: #09f;" id="span-ren">已认证</span>
                        </label>
                        <label class="fc-inline mr20 mt20">
                            <span><a style="padding: 5px 10px;background: #d20534;color:#fff;border-radius: 6px;" href="/accounts/email?newren={{$res->emailkey}}"  onclick= "return confirm('是否确修改');">修改认证</a></span>
                        </label>
                        </div>
                    @endif
                </div>

            </div>
        </div>
    </div>
@endsection